import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from "path"
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig((data)=>{
  console.log('data: ', data);
  const defaultConfigs= {
    server:{
      open:true, // 启动后会自动在浏览器打开
      port:8080,
    },
    resolve:{
      alias: {
        '@': resolve(__dirname, './src')
        },
    },
    plugins: [
      vue(),
      AutoImport({
        resolvers: [ElementPlusResolver()],
        imports:['vue','vue-router','pinia']
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  }
  return defaultConfigs
})
